package learn_design_patterns.c4.pizzafm;

import java.util.ArrayList;

public abstract class Pizza {
	String name;
	String dough;
	String sauce;

	ArrayList<String> toppings = new ArrayList<>();

	public void prepare() {
		System.out.println("Preparing " + name);
		System.out.println("Tossing dough...");
		System.out.println("Adding sauce...");
		System.out.println("Adding toppings: ");
		for (String t : toppings) {
			System.out.println("  " + t);
		}

	}

	public void bake() {
		System.out.println("Bake for 25 minutes at 350");
	}

	public void cut() {
		System.out.println("Cutting the pizza into diagonal slices");
	}

	public void box() {
		System.out.println("Place pizza in official PizzaStore box");
	}

	public String getName() {
		return name;
	}

	@Override
	public String toString() {
		StringBuffer display = new StringBuffer();
		display.append("----" + name + "----");
		display.append(dough + "\n");
		display.append(sauce + "\n");
		for (String t : toppings) {
			display.append(t + "\n");
		}
		return display.toString();
	}

}
